package cn.zn.modules.pz.his.entity.vo;

import cn.zn.framework.common.utils.Number2CN;
import cn.zn.modules.pz.enums.ProcessLevelEnum;
import cn.zn.modules.pz.enums.ProcessStateEnum;
import cn.zn.modules.pz.enums.SpendingTypeEnum;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class PzRequestVO implements IPz {
    private PzMainVO pzMainVO = new PzMainVO();
    private Boolean isExpense;
    private String docCodeDw;
    private String docCodeYz;
    private String budgetStr;
    /**
     * 经费名称: 经费、专家经费、专项经费
     */
    private String spendingName;
    private PzTripTicketVO pzTripTicketVO;

    @Override
    public String getMoneyBig() {
        return this.pzMainVO.getMoney() != null ? Number2CN.number2CNMontrayUnit(BigDecimal.valueOf(this.pzMainVO.getMoney())) : "";
    }

    @Override
    public String getLevelName() {
        if (pzMainVO.getLevel() == null) {
            return "";
        }
        return ProcessLevelEnum.findByCode(pzMainVO.getLevel()).getName();
    }

    @Override
    public String getSpendingTypeName() {
        if (pzMainVO.getSpendingType() == null) {
            return "";
        }
        return SpendingTypeEnum.findByCode(pzMainVO.getSpendingType()).getName();
    }

    @Override
    public String getStateName() {
        if (pzMainVO.getState() == null) {
            return "";
        }
        return ProcessStateEnum.findByCode(pzMainVO.getState()).getName();
    }

    @Override
    public void setApplyDeptName(String applyDeptName) {
        this.pzMainVO.setApplyDeptName(applyDeptName);
    }
}
